package com.free.common.model;

import cn.hutool.core.bean.BeanUtil;
import lombok.Data;
import org.springframework.data.domain.Example;

@Data
public class JpaExample<T> {

    private T o;

    public JpaExample setProperties(String name, Object value) {
        BeanUtil.setProperty(o, name, value);
        return this;
    }

    public Example query() {
        return Example.of(o);
    }

}
